package com.itheima.edu.info.test;

public class test02 {
    public static void main(String[] args) {
       /* InterImpl ii = new InterImpl();
        ii.show();*/

        new Inter() {
            @Override
            public void show() {
                System.out.println("我是匿名内部类中的show方法");
            }
        }.show();

        //情况：接口中存在多个方法
        new Inter2() {

            @Override
            public void show1() {
                System.out.println("show1...");
            }

            @Override
            public void show2() {
                System.out.println("show2...");
            }
        };
    }

}


interface Inter {
    void show();
}

interface Inter2 {
    void show1();

    void show2();
}

class InterImpl implements Inter {

    @Override
    public void show() {
        System.out.println("InterImpl  重写的show方法");
    }
}
